﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" x:Class="MenuModule.MenuView"    
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="#FFCCB5B5">
        <Border BorderBrush="#FF3B9555" BorderThickness="4" Margin="0,-8,0,0" CornerRadius="9">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0"/>
                    <GradientStop Color="#FF9F8C8C" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>

            <Grid Background="#FFD4C2C2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="0.643*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="MenuStack" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Center">
                    <ListBox x:Name="UserMenu" ItemsSource="{Binding Commands}" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding MenuName}"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>                       
                    	<i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction
                                    Command="{Binding Path=RootCommand}"
                                    CommandParameter="{Binding SelectedItem,ElementName=UserMenu}"/>
                    		</i:EventTrigger>
                    	</i:Interaction.Triggers>

                       
                    </ListBox>

                </StackPanel>
               


            </Grid>
        </Border>
    </Grid>
</UserControl>
